home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PBLIB1 / PROGS / COMPILE.PAS < prev    next >
Pascal/Delphi Source File  |  1994-05-03  |  3KB  |  97 lines

  1. PROGRAM COMPILE;
  2.  
  3. {$M 15000,0,25000}
  4.  
  5. Uses PbMISC, PbDATA, PbOBJS, PbPARMS, PbOUT0;
  6.  
  7. {
  8. Description : Compiles a bunch of files at once, reports failures
  9.  
  10. Author      : Howard Richoux
  11. Date        : 12/20/93
  12. Last revised: 12/25/93 hnr 1.02 PbOUT output
  13.                2/18/94 HNR 1.04 NEW LIBRARIES
  14. Application : IBM PC and compatibles, done in Turbo Pascal 7.0
  15. Status      : Placed in the Public Domain by HNR Software 1/29/94
  16. Published in: none
  17.  
  18. Config Parameters        meaning
  19. MINSIZEK=100             100k bytes        demo param, not used
  20.  
  21. }
  22.  
  23.  
  24. var srclistname : string;
  25. var srclist     : HOLD_object;
  26.  
  27.  
  28. {*****************************************************************}
  29.  
  30. Procedure GoOn;      { Initialization is over, do some work.}
  31. var fn : string;
  32.     i,err, failed,good  : integer;
  33.     ok             : boolean;
  34.     longerr        : longint;
  35.      begin
  36.      err := 0; failed := 0; good := 0;
  37.      srclist.init(100);
  38.      srclist.load(srclistname);
  39.      for i := 1 to srclist.count do
  40.           begin
  41.           fn := srclist.fetchstrN(i);
  42.           forceext(fn,'pas');
  43.           ok := TPC(fn,'',err);
  44.           if err <> 0 then inc(failed)
  45.           else inc(good);
  46.           ok := srclist.storeN(i,fn,err);
  47.           end;
  48.      OUT(' ');
  49.      OUT(integerstr(good,3)+'  Compiles OK. ');
  50.      if failed = 0 then
  51.           begin
  52.           OUT('     All files compiled OK  '+integerstr(srclist.count,3));
  53.           end
  54.      else begin
  55.           OUT(integerstr(failed,3)+'  Compiles failed. ');
  56.           OUT('     The first failure was: ');
  57.           i := 1;
  58.           while i < srclist.count do
  59.               begin
  60.               ok := srclist.fetchN(i,fn,longerr);
  61.               if longerr <> 0 then
  62.                    begin
  63.                    ok := srclist.fetchN(i,fn,longerr);
  64.                    OUT('     '+fn+'  '+longintstr(longerr,4));
  65.                    ok := TPC(fn,'',err);
  66.                    i := 9999;
  67.                    end;
  68.               inc(i);
  69.               end;
  70.           end;
  71.      end;
  72.  
  73.  
  74. Procedure Init;
  75. var s : string;
  76.     begin
  77.  
  78.     StandardOUTInit;                    { also calls StandardpVarsInit }
  79.     srclistname := 'compile.cmd';
  80.     if paramcount > 0 then
  81.          begin
  82.          srclistname := paramstr(1);
  83.          RemoveLeading(srclistname,'@');
  84.          end;
  85.     end;
  86.  
  87.  
  88. (*  Main program *)
  89.     BEGIN
  90.     pProgID := 'Compile 1.04';
  91.     Init;
  92.     GoOn;
  93.     OUTdone;
  94.     end.
  95.  
  96.  
  97.